<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*,
com.brother.model.*,com.brother.service.*"   pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ include file="../international.jsp" %> 
<%
String trackerId = request.getParameter("trackerId");
TrackerService tks = new TrackerService();

Tracker tracker = tks.getTrackerByFieldName("trackerId", trackerId);
AlarmService alService = new AlarmService();
Alarm alarm = new Alarm();
alarm.setTrackerId(trackerId);
alarm.setAlarmType(AlarmType.Over_Speed_Alarm.toString());
List<Alarm> alarms = alService.findAlarms(alarm);
alarm = alarms.size() > 0 ? alarms.get(0):null;
%>
<html><head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title><fmt:message key="control.speed.limit.title"/></title>
<link rel="stylesheet" type="text/css" media="all" href="../style.css">
</head><body>
<br><br>
<table align="center" border="0" width="80%">
<form id="control" name="control" method="post" action="./setControl.jsp">
  <tbody><tr>
    <td><fmt:message key="tracker.name"/>:</td>
    <td><%=tracker.getTrackerName()%> - <%=tracker.getModelName()%>&nbsp;</td>
  </tr>
  <tr>
    <td><fmt:message key="tracker.id"/>:</td>
    <td><%=tracker.getUserTrackerId()%>&nbsp;</td>
  </tr>
  <tr>
    <td><fmt:message key="control.speed.limit"/>:</td>
    <td>
        <input name="data" value="<%=alarm == null ? "":alarm.getValue1() %>" size="5"> (KM/H)	</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center"><label>
	  <input name="trackerId" value="<%=tracker.getTrackerid()%>" type="hidden">
	  <input name="action" value="speed" type="hidden"/>
      <input name="Submit" value="<fmt:message key="control.speed.submit.to.tracker"/>" type="submit">
    </label></td>
  </tr>

</tbody>
</form>
</table>

</body></html>
<%
com.brother.database.DataBase.closeThreadConnection();
%>